package oj;

import java.util.Scanner;

public class Day21S {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()) {
            int n=sc.nextInt();
            String s = sc.next();
            int k = 1;//光标的初始位置
            int first=1;//第一首歌的位置
            if (n <= 4) {
                for (int i = 0; i < s.length(); i++) {
                    if (s.charAt(i) == 'U') {
                        k--;
                        if (k == 0) {
                            k = n;
                        }
                    } else {
                            k++;
                            if (k == n + 1) {
                                k = 1;
                            }
                        }
                    }
                } else {
                for (int i = 0; i < s.length(); i++) {
                    if (s.charAt(i) == 'U') {
                        k--;
                        if (k == 0) {
                            k = n;
                            first = k - 3;
                        }
                        if(k==first-1){
                            first--;
                        }
                    } else {
                        k++;
                        if(k==n+1){
                            k=1;
                            first=1;
                        }
                        if(k==first+4){
                            first++;
                        }
                    }
                }
            }
            if(n<=4){
                for (int i = 0; i < n; i++) {
                    System.out.print(first++ + " ");
                }
            }else {
                System.out.println(first+" "+(first+1)+" "+(first+2)+" "+(first+3));
            }
            System.out.println();
            System.out.println(k);
        }
    }
}
